package com.file.exercise;

import java.io.File;

/**
 * @author げっしょく
 * @date 2021/7/31
 */
public class Test6 {
    public static void main(String[] args) {
        File file = new File("D:\\itheima\\JavaSE");
        del(file);
    }

    public static void del(File dir) {
        File[] files = dir.listFiles();
        if(files != null){
            for (File file : files) {
                if (file.isFile()) {
                    file.delete();
                }else{
                    del(file);
                }
            }
        }
        dir.delete();
    }
}
